package com.objectproject.main.model;


import com.objectproject.main.enumeration.ValueType;


public class MyProperty {
	
	private long objectId;//삽입시에는 0으로 세팅
	private long propertyId;
	private MyGroup modificationAuth;
	private boolean isNext;
	private boolean isHidden;
	private boolean isStatic;
	private boolean isSystemProperty;
	private ValueType typeOfValue;
	private MyObject typeObjectQualifier;
	private boolean viewMini;
	private boolean viewSimple;
	private boolean viewCard;
	private boolean viewNormal;
	private int dedicatedLocaleId;
	private int depth;

	
	
	//derived by locale
	private int priority;
	private String label;
	private long valueId;
	private Object value;//it will be derived by value_id.
	private String helpText;
	
	
	

	

	public long getObjectId() {
		return objectId;
	}

	public void setObjectId(long objectId) {
		this.objectId = objectId;
	}

	public long getPropertyId() {
		return propertyId;
	}

	public void setPropertyId(long propertyId) {
		this.propertyId = propertyId;
	}

	public MyGroup getModificationAuth() {
		return modificationAuth;
	}

	public void setModificationAuth(MyGroup modificationAuth) {
		this.modificationAuth = modificationAuth;
	}

	public boolean isNext() {
		return isNext;
	}

	public void setNext(boolean isNext) {
		this.isNext = isNext;
	}

	public boolean isHidden() {
		return isHidden;
	}

	public void setHidden(boolean isHidden) {
		this.isHidden = isHidden;
	}

	public boolean isStatic() {
		return isStatic;
	}

	public void setStatic(boolean isStatic) {
		this.isStatic = isStatic;
	}

	public boolean isSystemProperty() {
		return isSystemProperty;
	}

	public void setSystemProperty(boolean isSystemProperty) {
		this.isSystemProperty = isSystemProperty;
	}

	public ValueType getTypeOfValue() {
		return typeOfValue;
	}

	public void setTypeOfValue(ValueType typeOfValue) {
		this.typeOfValue = typeOfValue;
	}

	public MyObject getTypeObjectQualifier() {
		return typeObjectQualifier;
	}

	public void setTypeObjectQualifier(MyObject typeObjectQualifier) {
		this.typeObjectQualifier = typeObjectQualifier;
	}

	public boolean isViewMini() {
		return viewMini;
	}

	public void setViewMini(boolean viewMini) {
		this.viewMini = viewMini;
	}

	public boolean isViewSimple() {
		return viewSimple;
	}

	public void setViewSimple(boolean viewSimple) {
		this.viewSimple = viewSimple;
	}

	public boolean isViewCard() {
		return viewCard;
	}

	public void setViewCard(boolean viewCard) {
		this.viewCard = viewCard;
	}

	public boolean isViewNormal() {
		return viewNormal;
	}

	public void setViewNormal(boolean viewNormal) {
		this.viewNormal = viewNormal;
	}

	public int getDedicatedLocaleId() {
		return dedicatedLocaleId;
	}

	public void setDedicatedLocaleId(int dedicatedLocaleId) {
		this.dedicatedLocaleId = dedicatedLocaleId;
	}
	
	public int getDepth() {
		return depth;
	}

	public void setDepth(int depth) {
		this.depth = depth;
	}

	public int getPriority() {
		return priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public long getValueId() {
		return valueId;
	}

	public void setValueId(long valueId) {
		this.valueId = valueId;
	}

	public Object getValue() {
		return value;
	}

	public void setValue(Object value) {
		this.value = value;
	}

	public String getHelpText() {
		return helpText;
	}

	public void setHelpText(String helpText) {
		this.helpText = helpText;
	}
	
	
	
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof MyProperty){
			if(this.propertyId == 0 || ((MyProperty)obj).propertyId == 0){//구현바꾸면 여파 크다.
				return false;
			}else if(this.propertyId == ((MyProperty)obj).propertyId){
				return true;
			}
		}
		return false;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("----------------property---------------\n");
		sb.append("objectId: " + objectId + "\n");
		sb.append("propertyId: " + propertyId + "\n");
		if(modificationAuth != null)
			sb.append("modificationAuthId: " + modificationAuth.getGroupId() + "\n");
		sb.append("isNext: " + isNext + "\n");
		sb.append("isHidden: " + isHidden + "\n");
		sb.append("isStatic: " + isStatic + "\n");
		sb.append("isSystemProperty: " + isSystemProperty + "\n");
		sb.append("typeOfValue: " + typeOfValue + "\n");
		if(typeObjectQualifier != null)
			sb.append("typeObjectQualifierId: " + typeObjectQualifier.getObjectId() + "\n");
		sb.append("viewMini: " + viewMini + "\n");
		sb.append("viewSimple: " + viewSimple + "\n");
		sb.append("viewCard: " + viewCard + "\n");
		sb.append("viewNormal: " + viewNormal + "\n");
		sb.append("dedicatedLocaleId: " + dedicatedLocaleId + "\n");
		sb.append("depth: " + depth + "\n");
		
		sb.append("priority: " + priority + "\n");
		sb.append("label: " + label + "\n");
		sb.append("valueId: " + valueId + "\n");
		sb.append("value: " + value + "\n");
		sb.append("helpText: " + helpText + "\n\n");
		
		
		return sb.toString();
	}

}
